package com.example.demo.service;

import com.example.demo.dao.BaseDAO;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>DESC:   </p>
 * <p>2018/4/13</p>
 * <p>AUTHOR:DengC</p>
 */
public class BaseServiceImpl<T> implements BaseService<T> {
    @Autowired
    private BaseDAO<T, String> baseDAO;

    @Override
    public T getById(String id)  {
        return this.baseDAO.getById(id);
    }

    @Override
    public List<T> listAll()  {
        return this.baseDAO.listAll();
    }

    @Override
    public void delById(String id)  {
         this.baseDAO.delById(id);
    }

    @Override
    public T save(T entity)  {
        return this.baseDAO.save(entity);
    }

    @Override
    public T update(T entity)  {
        return this.baseDAO.save(entity);
    }


}
